﻿
Partial Class WebForm_Main_AddServiceBulletin
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Me.fv.InsertItemTemplate = Me.fv.ItemTemplate
        Me.fv.EditItemTemplate = Me.fv.ItemTemplate
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub
End Class

Partial Class WebForm_Main_AddServiceBulletin
    Public Sub Show(ByVal ServiceID As Integer)
        Me.ServiceID = ServiceID
        Me.BindData()
        Me.mpSearch.Show()
        Me.Visible = True
    End Sub

    Private Sub BindData()
        Dim dat As New clsData
        Dim sql As New MyStringBuilder
        Dim dt As Data.DataTable

        sql.Length = 0
        sql.AppendFormat("select s.* ")
        sql.AppendFormat(" from ServiceBulletin s ")
        sql.AppendFormat(" where s.ServiceID = {0} ", Me.ServiceID)

        dt = dat.GetData(sql)

        Me.lblForm.Text = dt.Rows(0)("ServiceSubject").ToString()

        Me.fv.ChangeMode(FormViewMode.ReadOnly)
        Me.fv.DataSource = dt
        Me.fv.DataBind()

    End Sub

    Private Property ServiceID() As Integer
        Get
            Return ViewState("ServiceID")
        End Get
        Set(ByVal value As Integer)
            ViewState("ServiceID") = value
        End Set
    End Property
End Class
